package com.wkbb.sports.dto;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.wkbb.common.handler.JsonUtil;
import com.wkbb.sports.enums.SportsModelTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;

@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class TrainStuDto {

    @ApiModelProperty(value = "训练ID")
    private Long trainId;
    @ApiModelProperty(value = "学生ID")
    private Long studentId;
    @ApiModelProperty(value = "训练模式")
    private Integer modelType;
    @ApiModelProperty(value = "运动时间")
    private Integer gameTime;
    @ApiModelProperty(value = "训练模式名称")
    private String modelTypeName;
    @ApiModelProperty(value = "成绩")
    private String achievement;
    @ApiModelProperty(value = "开始时间")
    private Date startTime;
    @ApiModelProperty(value = "结束时间")
    private Date endTime;

    @ApiModelProperty(value = "得分")
    private Double score;
    @ApiModelProperty(value = "加分项得分")
    private Double plusScore;
    @ApiModelProperty(value = "成绩等级：1优秀 2良好 3及格 4不及格")
    private int scoreLevel;
    @ApiModelProperty(value = "平均耗时")
    private Integer avgTime;
    @ApiModelProperty(value = "有效平均值(中位数)")
    private Integer medianTime;
    @ApiModelProperty(value = "绊绳总次数")
    private Integer errorCount;
    @ApiModelProperty(value = "失误总耗时")
    private Integer errorTime;
    @ApiModelProperty(value = "绊绳 损失次数")
    private Integer lossesCount1;
    @ApiModelProperty(value = "甩绳速度偏慢 损失次数")
    private Integer lossesCount2;
    @ApiModelProperty(value = "进入状态过慢 损失次数")
    private Integer lossesCount3;
    @ApiModelProperty(value = "进入状态耗时")
    private Integer intoStateTime;
    @ApiModelProperty(value = "训练详情")
    private List<TrainStudentDetailDto> details;
    public void setDetails(String details) {
        this.details = JsonUtil.jsonToList(details,TrainStudentDetailDto.class);
    }
}
